package com.mondo.financialwallet.data.repository.datasource;

import com.mondo.financialwallet.data.entity.BasisResponseEntity;
import com.mondo.financialwallet.data.entity.MyTokenListEntity;
import com.mondo.financialwallet.data.entity.TokenAddressEntity;
import com.mondo.financialwallet.data.entity.TokenTransactionRecordEntity;
import com.mondo.financialwallet.data.entity.WalletAssetEntity;
import com.mondo.financialwallet.data.net.WalletWebApi;
import com.mondo.financialwallet.data.net.WalletWebService;

import io.reactivex.Observable;

public class RemoteWalletDataStore implements WalletDataStore {

    // 每次分页数量
    private final int size = 10;

    @Override
    public Observable<MyTokenListEntity> myTokenList() {
        return WalletWebService.get().myTokenList();
    }

    @Override
    public Observable<TokenAddressEntity> generateTokenAddress(String id) {
        return WalletWebService.get().generateTokenAddress(id);
    }

    @Override
    public Observable<WalletAssetEntity> walletAsset() {
        return WalletWebService.get().asset();
    }

    @Override
    public Observable<WalletAssetEntity> walletAvailableBalance() {
        return WalletWebService.get().assetAvailable();
    }

    @Override
    public Observable<BasisResponseEntity> transfer(
            String id, String amount, String address, String remark) {
        return WalletWebService.get().transfer(id, amount, address, remark);
    }

    @Override
    public Observable<TokenTransactionRecordEntity> transactionRecordList(
            String tokenId, int page, int type) {

        return WalletWebService.get().transactionRecordList(page, size, "", tokenId);
    }
}
